package com.aizuda.boot.modules.business.contract.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

@Data
@Schema(description = "合同主表实体")
@TableName("contract")
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class ContractEntity {
    @Schema(description = "合同ID", example = "1")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "关联的审批流程ID，关联 contract_workflow 表", example = "1")
    @TableField("process_id")
    private Long processId;

    @Schema(description = "flw审批流程定义ID，关联flw框架的流程定义表")
    @TableField("approval_process_id")
    private Long approvalProcessId;

    @Schema(description = "flw审批流程实例ID，关联flw框架的流程实例表")
    @TableField("approval_instance_id")
    private Long approvalInstanceId;

    @Schema(description = "当前审批状态", example = "审批中", allowableValues = "草稿,审批中,已批准,已驳回,已归档")
    @TableField("current_status")
    private String currentStatus;

    @Schema(description = "系统租户键", example = "tenant_001")
    @TableField("sys_tenant_key")
    private String sysTenantKey;

    @Schema(description = "创建时间", example = "2023-07-20 10:00:00")
    @TableField("created_at")
    private LocalDateTime createdAt;

    @Schema(description = "更新时间", example = "2023-07-20 11:00:00")
    @TableField("updated_at")
    private LocalDateTime updatedAt;

    @Schema(description = "合同主合同文件ID")
    @TableField("main_contract_file_id")
    private Integer mainContractFileId;

    @Schema(description = "合同模版内容")
    @TableField("content")
    private String content;

    @Schema(description = "是否匹配字段：0-非导入合同，1-未匹配，2-已匹配", example = "0")
    @TableField("is_matched")
    private Integer isMatched;
}